﻿
@{
    ViewBag.Title = ViewBag.KeyWordTitle + "搜索结果";
    Layout = "~/Views/Shared/_Layout.cshtml";
}


<style type="text/css">
    .w1000 {
        max-width: 1000px;
        margin: 0 auto;
    }

    .layui-fixbar li {
        background: #6294b5;
    }
</style>


<div class="micronews-container micronews-search-container w1000">
    <div class="layui-fluid">
        <p class="num">为您找到相关结果为<span> &nbsp;@ViewBag.Data.Count&nbsp; </span>个</p>
        <div class="item-list" id="searchListDiv">
            @if (ViewBag.Data != null && ViewBag.Data.Data != null)
            {
                foreach (var item in ViewBag.Data.Data)
                {
                    <div class="item">
                        <h4><a target="_blank" href="@item.NewsUrl">@item.NewsTitle</a><span class="time">@item.PubTime</span></h4>
                        <p>@item.Abstract</p>
                    </div>
                }
            }

        </div>
        @*分页*@
        <div id="micronews-search-test" style="text-align: center; padding:30px 0"></div>
    </div>
</div>

<script id="searchList" type="text/html">
    {{#  layui.each(d.Data, function(index, item){ }}
    <div class="item">
        <h4><a target="_blank" href="{{item.NewsUrl}}">{{item.NewsTitle}}</a><span class="time">{{item.PubTime}}</span></h4>
        <p>{{item.Abstract}}</p>
    </div>
    {{#  }); }}
</script>


<!--[if lt IE 9]>
  <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>

    layui.config({
        base: '/Scripts/wenews/'
    }).use('index', function () {
        var index = layui.index;
        index.searchPage('micronews-search-test',@ViewBag.Data.Count)
        //超出省略，在后端操作，前端会闪烁
        //index.omitted('.item p', 150)
        index.seachBtn('search')
        index.arrowutil()
        //index.footLayout()
        index.KeyWordHighLight()
        });

</script>


<div class="footer"></div>